cmake_minimum_required(VERSION 3.10)

SET(CMAKE_SYSTEM_NAME Linux)

#设置C语言所用编译器为arm-none-linux-gnueabi-gcc
SET(CMAKE_C_COMPILER   "/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc")

#设置C++语言所用编译器为arm-none-linux-gnueabi-g++
SET(CMAKE_CXX_COMPILER   "/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-g++")

project(lvgl)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)

include_directories(
        ${PROJECT_SOURCE_DIR}/
        ${PROJECT_SOURCE_DIR}/lvgl
        ${PROJECT_SOURCE_DIR}/lv_drivers
)

add_subdirectory(lvgl)
add_subdirectory(lv_drivers)

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
add_executable(main main.c ${SOURCES} ${INCLUDES})
target_link_libraries(main PRIVATE lvgl lvgl::drivers lvgl::demos)
add_custom_target(run COMMAND ${EXECUTABLE_OUTPUT_PATH}/main)
